\(\int (a+b \csc (c+d x))^3 \, dx\) [37]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 73 \[ \int (a+b \csc (c+d x))^3 \, dx=a^3 x-\frac {b \left (6 a^2+b^2\right ) \text {arctanh}(\cos (c+d x))}{2 d}-\frac {5 a b^2 \cot (c+d x)}{2 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))}{2 d} \]

[Out]

a^3*x-1/2*b*(6*a^2+b^2)*arctanh(cos(d*x+c))/d-5/2*a*b^2*cot(d*x+c)/d-1/2*b^2*cot(d*x+c)*(a+b*csc(d*x+c))/d

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3867, 3855, 3852, 8} \[ \int (a+b \csc (c+d x))^3 \, dx=a^3 x-\frac {b \left (6 a^2+b^2\right ) \text {arctanh}(\cos (c+d x))}{2 d}-\frac {5 a b^2 \cot (c+d x)}{2 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))}{2 d} \]

[In]

Int[(a + b*Csc[c + d*x])^3,x]

[Out]

a^3*x - (b*(6*a^2 + b^2)*ArcTanh[Cos[c + d*x]])/(2*d) - (5*a*b^2*Cot[c + d*x])/(2*d) - (b^2*Cot[c + d*x]*(a +
b*Csc[c + d*x]))/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3867

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-b^2)*Cot[c + d*x]*((a + b*Csc[c + d*x])^(
n - 2)/(d*(n - 1))), x] + Dist[1/(n - 1), Int[(a + b*Csc[c + d*x])^(n - 3)*Simp[a^3*(n - 1) + (b*(b^2*(n - 2)
+ 3*a^2*(n - 1)))*Csc[c + d*x] + (a*b^2*(3*n - 4))*Csc[c + d*x]^2, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ
[a^2 - b^2, 0] && GtQ[n, 2] && IntegerQ[2*n]

Rubi steps \begin{align*} \text {integral}& = -\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))}{2 d}+\frac {1}{2} \int \left (2 a^3+b \left (6 a^2+b^2\right ) \csc (c+d x)+5 a b^2 \csc ^2(c+d x)\right ) \, dx \\ & = a^3 x-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))}{2 d}+\frac {1}{2} \left (5 a b^2\right ) \int \csc ^2(c+d x) \, dx+\frac {1}{2} \left (b \left (6 a^2+b^2\right )\right ) \int \csc (c+d x) \, dx \\ & = a^3 x-\frac {b \left (6 a^2+b^2\right ) \text {arctanh}(\cos (c+d x))}{2 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))}{2 d}-\frac {\left (5 a b^2\right ) \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{2 d} \\ & = a^3 x-\frac {b \left (6 a^2+b^2\right ) \text {arctanh}(\cos (c+d x))}{2 d}-\frac {5 a b^2 \cot (c+d x)}{2 d}-\frac {b^2 \cot (c+d x) (a+b \csc (c+d x))}{2 d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(152\) vs. \(2(73)=146\).

Time = 3.44 (sec) , antiderivative size = 152, normalized size of antiderivative = 2.08 \[ \int (a+b \csc (c+d x))^3 \, dx=\frac {8 a^3 c+8 a^3 d x-12 a b^2 \cot \left (\frac {1}{2} (c+d x)\right )-b^3 \csc ^2\left (\frac {1}{2} (c+d x)\right )-24 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-4 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+24 a^2 b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 b^3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^3 \sec ^2\left (\frac {1}{2} (c+d x)\right )+12 a b^2 \tan \left (\frac {1}{2} (c+d x)\right )}{8 d} \]

[In]

Integrate[(a + b*Csc[c + d*x])^3,x]

[Out]

(8*a^3*c + 8*a^3*d*x - 12*a*b^2*Cot[(c + d*x)/2] - b^3*Csc[(c + d*x)/2]^2 - 24*a^2*b*Log[Cos[(c + d*x)/2]] - 4
*b^3*Log[Cos[(c + d*x)/2]] + 24*a^2*b*Log[Sin[(c + d*x)/2]] + 4*b^3*Log[Sin[(c + d*x)/2]] + b^3*Sec[(c + d*x)/
2]^2 + 12*a*b^2*Tan[(c + d*x)/2])/(8*d)

Maple [A] (verified)

Time = 0.72 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.16

method result size
parts \(a^{3} x +\frac {b^{3} \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{2}\right )}{d}-\frac {3 a^{2} b \ln \left (\csc \left (d x +c \right )+\cot \left (d x +c \right )\right )}{d}-\frac {3 a \,b^{2} \cot \left (d x +c \right )}{d}\) \(85\)
derivativedivides \(\frac {a^{3} \left (d x +c \right )+3 a^{2} b \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )-3 a \,b^{2} \cot \left (d x +c \right )+b^{3} \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{2}\right )}{d}\) \(86\)
default \(\frac {a^{3} \left (d x +c \right )+3 a^{2} b \ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )-3 a \,b^{2} \cot \left (d x +c \right )+b^{3} \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{2}\right )}{d}\) \(86\)
parallelrisch \(\frac {4 \left (6 a^{2} b +b^{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 a^{3} x d -\cot \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b^{3}+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b^{3}-12 \cot \left (\frac {d x}{2}+\frac {c}{2}\right ) a \,b^{2}+12 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a \,b^{2}}{8 d}\) \(97\)
norman \(\frac {a^{3} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-\frac {b^{3}}{8 d}+\frac {b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{8 d}-\frac {3 a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d}+\frac {3 a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{2 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {b \left (6 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) \(121\)
risch \(a^{3} x +\frac {b^{2} \left (-6 i a \,{\mathrm e}^{2 i \left (d x +c \right )}+b \,{\mathrm e}^{3 i \left (d x +c \right )}+6 i a +b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}\) \(149\)

[In]

int((a+b*csc(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

a^3*x+b^3/d*(-1/2*csc(d*x+c)*cot(d*x+c)+1/2*ln(-cot(d*x+c)+csc(d*x+c)))-3*a^2*b/d*ln(csc(d*x+c)+cot(d*x+c))-3*
a*b^2*cot(d*x+c)/d

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 155 vs. \(2 (67) = 134\).

Time = 0.25 (sec) , antiderivative size = 155, normalized size of antiderivative = 2.12 \[ \int (a+b \csc (c+d x))^3 \, dx=\frac {4 \, a^{3} d x \cos \left (d x + c\right )^{2} - 4 \, a^{3} d x + 12 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 2 \, b^{3} \cos \left (d x + c\right ) + {\left (6 \, a^{2} b + b^{3} - {\left (6 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (6 \, a^{2} b + b^{3} - {\left (6 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]

[In]

integrate((a+b*csc(d*x+c))^3,x, algorithm="fricas")

[Out]

1/4*(4*a^3*d*x*cos(d*x + c)^2 - 4*a^3*d*x + 12*a*b^2*cos(d*x + c)*sin(d*x + c) + 2*b^3*cos(d*x + c) + (6*a^2*b
 + b^3 - (6*a^2*b + b^3)*cos(d*x + c)^2)*log(1/2*cos(d*x + c) + 1/2) - (6*a^2*b + b^3 - (6*a^2*b + b^3)*cos(d*
x + c)^2)*log(-1/2*cos(d*x + c) + 1/2))/(d*cos(d*x + c)^2 - d)

Sympy [F]

\[ \int (a+b \csc (c+d x))^3 \, dx=\int \left (a + b \csc {\left (c + d x \right )}\right )^{3}\, dx \]

[In]

integrate((a+b*csc(d*x+c))**3,x)

[Out]

Integral((a + b*csc(c + d*x))**3, x)

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.30 \[ \int (a+b \csc (c+d x))^3 \, dx=a^{3} x + \frac {b^{3} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} - \frac {3 \, a^{2} b \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{d} - \frac {3 \, a b^{2}}{d \tan \left (d x + c\right )} \]

[In]

integrate((a+b*csc(d*x+c))^3,x, algorithm="maxima")

[Out]

a^3*x + 1/4*b^3*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1))/d - 3*a^
2*b*log(cot(d*x + c) + csc(d*x + c))/d - 3*a*b^2/(d*tan(d*x + c))

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.84 \[ \int (a+b \csc (c+d x))^3 \, dx=\frac {b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, {\left (d x + c\right )} a^{3} + 12 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 4 \, {\left (6 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {36 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 6 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]

[In]

integrate((a+b*csc(d*x+c))^3,x, algorithm="giac")

[Out]

1/8*(b^3*tan(1/2*d*x + 1/2*c)^2 + 8*(d*x + c)*a^3 + 12*a*b^2*tan(1/2*d*x + 1/2*c) + 4*(6*a^2*b + b^3)*log(abs(
tan(1/2*d*x + 1/2*c))) - (36*a^2*b*tan(1/2*d*x + 1/2*c)^2 + 6*b^3*tan(1/2*d*x + 1/2*c)^2 + 12*a*b^2*tan(1/2*d*
x + 1/2*c) + b^3)/tan(1/2*d*x + 1/2*c)^2)/d

Mupad [B] (verification not implemented)

Time = 18.59 (sec) , antiderivative size = 234, normalized size of antiderivative = 3.21 \[ \int (a+b \csc (c+d x))^3 \, dx=\frac {b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {b^3\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {b^3\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2\,d}+\frac {2\,a^3\,\mathrm {atan}\left (\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+6\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}\right )}{d}+\frac {3\,a^2\,b\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {3\,a\,b^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {3\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \]

[In]

int((a + b/sin(c + d*x))^3,x)

[Out]

(b^3*tan(c/2 + (d*x)/2)^2)/(8*d) - (b^3*cot(c/2 + (d*x)/2)^2)/(8*d) + (b^3*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d
*x)/2)))/(2*d) + (2*a^3*atan((2*a^3*cos(c/2 + (d*x)/2) + b^3*sin(c/2 + (d*x)/2) + 6*a^2*b*sin(c/2 + (d*x)/2))/
(b^3*cos(c/2 + (d*x)/2) - 2*a^3*sin(c/2 + (d*x)/2) + 6*a^2*b*cos(c/2 + (d*x)/2))))/d + (3*a^2*b*log(sin(c/2 +
(d*x)/2)/cos(c/2 + (d*x)/2)))/d - (3*a*b^2*cot(c/2 + (d*x)/2))/(2*d) + (3*a*b^2*tan(c/2 + (d*x)/2))/(2*d)